﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DZPK.SocketImpl;

namespace DZPK
{
    public class TestLogin
    {
        public static TcpSocket socketImpl = new TcpSocket(null);
        public static void TestLoginToRoom()
        {
            socketImpl.connect("120.132.147.4", 7109);
        }

        public static void SendLoginMessage()
        {
            //SocketManager.instance.SendLogin(_local2.id, _local1.mid, SelfData.instance.userkey, _local1.userName, _local1.imgUrl, _local1.level.toString(), _local1.userOther, _local1.gift);
            int cmd = 4097;
            int packetver = 2;
            int subpacketver = 2;
            int roomID = 9;
            int mid = 16041193;
            string userkey = "28c0043073d1f812f4492de7c2c931bc";// "670f721e5cbf00f7f3c0639a4b387b0f";'28c0043073d1f812f4492de7c2c931bc',
            string username = "fddadsfdafhenry";
            string imgurl = "";
            string level = "2";
            string userOther = "";
            string gift = "";
            socketImpl.writeBegin(cmd, packetver, subpacketver);
            socketImpl.writeInt(roomID);
            socketImpl.writeInt(mid);
            socketImpl.writeString(userkey);
            socketImpl.writeString(username);
            socketImpl.writeString(imgurl);
            socketImpl.writeString(level);
            socketImpl.writeString(userOther);
            socketImpl.writeString(gift);
            socketImpl.writeEnd();
            socketImpl.sendcmd();
        }
    }
}
